<?php
/**
 * Created by PhpStorm.
 * User: 明哲
 * Date: 2016/6/6
 * Time: 10:22
 */
include('../../config.php');

$action = $_GET['action'];
$del_id = $_GET['id'];

switch ($action) {
    case 'del' :
        $rows = $mysql->query("delete from `ad_type` where `id`='{$del_id}'");
        echo 1;
        break;
    case 'add' :
        $name = $_GET['name'];
        $rows = $mysql->query("insert into `ad_type` set  `name`= '{$name}'");
        echo 1;
        break;

}